<?php
if(!defined('ADMIN')){
	exit('Access Denied');
}




$catid=83;
if(empty($catid)){
    jump('300','没有选择栏目名称','');
}


$categoryinfo=$ezhand->select("category",'*'," id=".$catid);
if(empty($categoryinfo)){
   jump('300','栏目不存在!',''); 
}
$catename=$categoryinfo["catname"];
$modelid=$categoryinfo["modelid"];
$liststyle=$categoryinfo["liststyle"];


$page = !($_POST['pageNum'])?'1':intval($_POST['pageNum']);
$pagesize= !($_POST['numPerPage'])?'20':intval($_POST['numPerPage']);


if(empty($pagesize)){
    $pagesize=20;
}
$frmnum=($page-1)*$pagesize;
$orderField=trim($_POST["orderField"]);
$orderDirection=trim($_POST["orderDirection"]);
if(empty($orderField)){
    $orderField="id";
}
if(empty($orderDirection)){
    $orderDirection="desc";
}
if($orderField<>""){
    $order=" order by $orderField ".$orderDirection;
}else{
    $order=" order by t.id desc";
}
$q=trim($_POST['q']);
$where="";
if(!empty($q)){
    $where.=" and t.title like '%$q%'";
}

    $total=$ezhand->count("hr_todolist t,hr h,school s,jobs j,company c"," t.tid=h.tid and t.schoolid=s.tid and t.jobsid=j.tid and t.companyid=c.tid  ".$where);
    $row=$ezhand->select_all("hr_todolist t,hr h,school s,jobs j,company c",'t.id,t.tid,t.addtime,t.jobsid,h.title as realname,h.sex,h.area_district,h.area_province,h.area_city,h.birthday,h.nation,h.polity,h.mainprofession,h.refer,s.title as schoolname,j.title as jobsname,c.title as companyname'," t.tid=h.tid and t.schoolid=s.tid and t.jobsid=j.tid and t.companyid=c.tid ".$where." order by t.addtime desc limit ".$frmnum.",".$pagesize);
    



?>